Skip to content

feat!: remove TanStack, and own the form engine - #241

Closed
pathscale wants to merge 1 commit into
feat/glass-material-axisfrom
feat/nuke-tanstack
Closed

feat!: remove TanStack, and own the form engine#241
pathscale wants to merge 1 commit into
feat/glass-material-axisfrom
feat/nuke-tanstack

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Stacked on #240 (glass). Review that first; this PR's diff is only the TanStack removal.

Three TanStack packages were the last things pinning this library to Solid 1, and none was earning its place.

solid-table and solid-virtual: shims nothing used

@tanstack/solid-table backed seven public hooks that no component in this library used. createDataGrid already answers the same questions natively — its rows derive filteredRows → sortedRows → pageRows, with selection alongside — so the hooks were a second table engine kept alive only by their own exports. @tanstack/solid-virtual was the same story in one file.

useAnchoredOverlayPosition stays. It never touched TanStack, and a grid still needs to position an overlay against a cell.

solid-form: load-bearing, so replaced

This one was real. FormField rendered <tsForm.Field>, FormSubmitButton rendered <tsForm.Subscribe>, and FormApi was literally { _tsForm: any } — twelve erased generics were part of this library's public type.

The replacement is small because the field components already carry the hard part: Input, Select, Checkbox and the rest own their presentation, state="invalid" and error slot. What was missing is bookkeeping — values, touched, errors, and when to run the schema. Standard Schema is now called directly, which is what TanStack was doing on our behalf anyway.

Two behaviours are explicit rather than inherited:

  • errors are gated on isTouched, so a form does not open covered in red
  • a failed submit() touches every field, so every error it refused on becomes visible at once rather than one blur at a time

There is a test for the second. The old suite had no way to express it.

Also: ten dead dependencies

Every @solid-primitives/* package was declared in package.json and imported from nowhere — not src, tests, scripts or playground. Removed with the rest. 28 packages leave the install.

Verification

  • tsc --noEmit — clean
  • bun run check — 90/90 components pass
  • bun run build — clean
  • bun test — 86/86 pass (was 85; one added for the submit-touches-everything rule)

Breaking changes

useTableModel, useTableSorting, useTablePagination, useTableFiltering, useTableSelection, useTableExpansion, toSortDescriptor, toSortingState and useVirtualRows are removed with their option/result types. Use createDataGrid; row expansion has no replacement yet and is the one capability lost.

FormApi._tsForm is gone, replaced by values(), getFieldValue, getFieldMeta, setFieldValue, validateField, submit(), isSubmitting(), isValid().

Three TanStack packages were the last things pinning this library to Solid 1,
and none of them was earning its place.

`@tanstack/solid-table` backed seven public hooks that **nothing in this
library used**. `createDataGrid` already answers the same questions natively -
its rows derive `filteredRows -> sortedRows -> pageRows` with selection
alongside - so the hooks were a second table engine kept alive by their own
exports. `@tanstack/solid-virtual` was the same story in one file.
`useAnchoredOverlayPosition` stays: it never touched TanStack and a grid still
needs to position an overlay against a cell.

`@tanstack/solid-form` was different, and it is the work here. It was load
bearing: `FormField` rendered `<tsForm.Field>`, `FormSubmitButton` rendered
`<tsForm.Subscribe>`, and `FormApi` was literally `{ _tsForm: any }`, so
twelve erased generics were part of this library's public type.

The replacement is small because the field components already carry the hard
part - `Input`, `Select` and the rest own their presentation, `state="invalid"`
and error slot. What was missing was bookkeeping: values, touched, errors, and
when to run the schema. Standard Schema is called directly, which is what
TanStack was doing on our behalf anyway.

Two behaviours are now explicit rather than inherited. Errors are gated on
`isTouched` so a form does not open covered in red, and a failed `submit()`
touches every field, so the errors it refused on all become visible at once
rather than one blur at a time. There is a test for the second, which the old
suite had no way to express.

Also drops ten `@solid-primitives/*` packages. Every one was declared in
`package.json` and imported from nowhere - not in `src`, `tests`, `scripts` or
`playground`. 28 packages leave the install.

BREAKING CHANGE: `useTableModel`, `useTableSorting`, `useTablePagination`,
`useTableFiltering`, `useTableSelection`, `useTableExpansion`,
`toSortDescriptor`, `toSortingState` and `useVirtualRows` are removed, with
their option and result types. Use `createDataGrid`, which covers filtering,
sorting, pagination and selection; row expansion has no replacement yet.
`FormApi._tsForm` is gone, replaced by `values()`, `getFieldValue`,
`getFieldMeta`, `setFieldValue`, `validateField`, `submit()`, `isSubmitting()`
and `isValid()`.
@pathscale

Copy link
Copy Markdown
Owner Author

Superseded by #242, which now targets master directly and carries these commits. Collapsed to a single PR so the whole 2.6 line is one QA pass.

@pathscale pathscale closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant